interface Animal{
    void sleep();
}
class Cat implements Animal {
    @Override
    public void sleep() {
        System.out.println("猫晚上睡觉");
    }
}
class Pig implements Animal {
    @Override
    public void sleep() {
        System.out.println("猪整天睡觉");
    }
}
public class Test3 {
    public static void main(String[] args) {
        Animal cat=new Cat();
        cat.sleep();
        Animal pig=new Pig();
        pig.sleep();
    }
}